package com.com.typhoon.service;

import com.com.typhoon.dao.PermissionDao;
import com.com.typhoon.dao.UserDao;
import com.com.typhoon.entity.Permission;
import com.com.typhoon.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author shuya | dongfeng.zdf@alibaba-inc.com
 * @description
 * @date 2018/10/30 上午10:28
 * @description
 * @modified by
 * @since V2.0.0
 */
@Service
@Slf4j
public class UserService {

    @Autowired
    private UserDao userDao;

    @Autowired
    private PermissionDao permissionDao;

    public User findByUsername(String username) {
        return this.userDao.findByUsername(username);
    }

    public List<Permission> queryPermissionByRoles(List<Long> roleIds) {
        return this.permissionDao.queryPermissionByRoles(roleIds);
    }

}
